package com.bsoft.gol.hcs.specialist.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import hcn.specialist.BaseComplaintAttach;

import java.util.List;

/**
 * @Author zsf
 * @Date 2023/10/19 0019 9:31
 * @PackageName:com.bsoft.gol.hcs.specialist.dao
 * @ClassName: BaseComplaintAttachDAO
 * @Description: 投诉附件表
 * @Version 4.0.02
 */
public abstract class BaseComplaintAttachDAO extends HibernateSupportDelegateDAO<BaseComplaintAttach> {
    public BaseComplaintAttachDAO() {
        this.setKeyField("attachId");
    }

    /**
     * @param relevancyId
     * @param list
     * @return void
     * @description: 通过文件id和投诉id或则整改id删除被清理的附件
     * @author: zsf
     * @date: 2023/10/19 0019 13:51
     */
    @DAOMethod(sql = "delete from BaseComplaintAttach where relevancyId=:relevancyId and attachId not in(:list)")
    public abstract void removeByAttachIdList(@DAOParam("relevancyId") String relevancyId, @DAOParam("list") List<Integer> list);

    /**
    * @description: 查询整改里面的附件列表
     * @param relevancyId
     * @return java.util.List<hcn.specialist.BaseComplaintAttach>
    * @author: zsf
    * @date: 2023/10/19 0019 13:53
    */
    @DAOMethod(sql = " from BaseComplaintAttach where relevancyId =:relevancyId ")
    public abstract List<BaseComplaintAttach> findComplaintAttach(@DAOParam("relevancyId") String relevancyId);
}
